﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiWorldDraw_ : OdGiWorldDraw
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiWorldDraw_(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGiWorldDraw__SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiWorldDraw_ obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiWorldDraw_()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiWorldDraw_(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		private OdGiWorldGeometry WGeom
		{
			get
			{
				if (this.pWGeom == null)
				{
					this.pWGeom = new OdGiWorldGeometry_Internal(OdGiWorldDraw_.OdGiWorldDraw__OdGiWorldGeometry_Upcast(this.swigCPtr.Handle), false);
				}
				return this.pWGeom;
			}
		}

		public virtual void setExtents(OdGePoint3d newExtents)
		{
			this.WGeom.setExtents(newExtents);
		}

		public virtual void startAttributesSegment()
		{
			this.WGeom.startAttributesSegment();
		}

		private OdGiWorldGeometry Geom
		{
			get
			{
				if (this.pOdGiGeometry1 == null)
				{
					this.pOdGiGeometry1 = new OdGiWorldGeometry_Internal(OdGiWorldDraw_.OdGiWorldDraw__OdGiGeometry_Upcast(this.swigCPtr.Handle), false);
				}
				return this.pOdGiGeometry1;
			}
		}

		public virtual OdGeMatrix3d getModelToWorldTransform()
		{
			return this.Geom.getModelToWorldTransform();
		}

		public virtual OdGeMatrix3d getWorldToModelTransform()
		{
			return this.Geom.getWorldToModelTransform();
		}

		public virtual void pushModelTransform(OdGeVector3d normal)
		{
			this.Geom.pushModelTransform(normal);
		}

		public virtual void pushModelTransform(OdGeMatrix3d xfm)
		{
			this.Geom.pushModelTransform(xfm);
		}

		public virtual void popModelTransform()
		{
			this.Geom.popModelTransform();
		}

		public virtual void circle(OdGePoint3d center, double radius, OdGeVector3d normal)
		{
			this.Geom.circle(center, radius, normal);
		}

		public virtual void circle(OdGePoint3d firstPoint, OdGePoint3d secondPoint, OdGePoint3d thirdPoint)
		{
			this.Geom.circle(firstPoint, secondPoint, thirdPoint);
		}

		public virtual void circularArc(OdGePoint3d center, double radius, OdGeVector3d normal, OdGeVector3d startVector, double sweepAngle, OdGiArcType arcType)
		{
			this.Geom.circularArc(center, radius, normal, startVector, sweepAngle, arcType);
		}

		public virtual void circularArc(OdGePoint3d center, double radius, OdGeVector3d normal, OdGeVector3d startVector, double sweepAngle)
		{
			this.Geom.circularArc(center, radius, normal, startVector, sweepAngle);
		}

		public virtual void circularArc(OdGePoint3d firstPoint, OdGePoint3d secondPoint, OdGePoint3d thirdPoint, OdGiArcType arcType)
		{
			this.Geom.circularArc(firstPoint, secondPoint, thirdPoint, arcType);
		}

		public virtual void circularArc(OdGePoint3d firstPoint, OdGePoint3d secondPoint, OdGePoint3d thirdPoint)
		{
			this.Geom.circularArc(firstPoint, secondPoint, thirdPoint);
		}

		public virtual void polyline(OdGePoint3d[] numVertices, OdGeVector3d pNormal, IntPtr baseSubEntMarker)
		{
			this.Geom.polyline(numVertices, pNormal, baseSubEntMarker);
		}

		public virtual void polyline(OdGePoint3d[] numVertices, OdGeVector3d pNormal)
		{
			this.Geom.polyline(numVertices, pNormal);
		}

		public virtual void polyline(OdGePoint3d[] numVertices)
		{
			this.Geom.polyline(numVertices);
		}

		public virtual void polygon(OdGePoint3d[] numVertices)
		{
			this.Geom.polygon(numVertices);
		}

		public virtual void pline(OdGiPolyline polyline, uint fromIndex, uint numSegs)
		{
			this.Geom.pline(polyline, fromIndex, numSegs);
		}

		public virtual void pline(OdGiPolyline polyline, uint fromIndex)
		{
			this.Geom.pline(polyline, fromIndex);
		}

		public virtual void pline(OdGiPolyline polyline)
		{
			this.Geom.pline(polyline);
		}

		public virtual void mesh(MeshData numRows)
		{
			this.Geom.mesh(numRows);
		}

		public virtual void shell(ShellData numVertices)
		{
			this.Geom.shell(numVertices);
		}

		public virtual void text(OdGePoint3d position, OdGeVector3d normal, OdGeVector3d direction, double height, double width, double oblique, string msg)
		{
			this.Geom.text(position, normal, direction, height, width, oblique, msg);
		}

		public virtual void text(OdGePoint3d position, OdGeVector3d normal, OdGeVector3d direction, string msg, bool raw, OdGiTextStyle pTextStyle)
		{
			this.Geom.text(position, normal, direction, msg, raw, pTextStyle);
		}

		public virtual void xline(OdGePoint3d firstPoint, OdGePoint3d secondPoint)
		{
			this.Geom.xline(firstPoint, secondPoint);
		}

		public virtual void ray(OdGePoint3d basePoint, OdGePoint3d throughPoint)
		{
			this.Geom.ray(basePoint, throughPoint);
		}

		public virtual void nurbs(OdGeNurbCurve3d nurbsCurve)
		{
			this.Geom.nurbs(nurbsCurve);
		}

		public virtual void ellipArc(OdGeEllipArc3d ellipArc, OdGePoint3d[] endPointsOverrides, OdGiArcType arcType)
		{
			this.Geom.ellipArc(ellipArc, endPointsOverrides, arcType);
		}

		public virtual void ellipArc(OdGeEllipArc3d ellipArc, OdGePoint3d[] endPointsOverrides)
		{
			this.Geom.ellipArc(ellipArc, endPointsOverrides);
		}

		public virtual void ellipArc(OdGeEllipArc3d ellipArc)
		{
			this.Geom.ellipArc(ellipArc);
		}

		public virtual void draw(OdGiDrawable pDrawable)
		{
			this.Geom.draw(pDrawable);
		}

		public virtual void pushClipBoundary(OdGiClipBoundary pBoundary)
		{
			this.Geom.pushClipBoundary(pBoundary);
		}

		public virtual void popClipBoundary()
		{
			this.Geom.popClipBoundary();
		}

		public virtual void worldLine(OdGePoint3d points)
		{
			this.Geom.worldLine(points);
		}

		public new virtual OdGiPathNode currentGiPath()
		{
			return this.Geom.currentGiPath();
		}

		public new virtual OdGiWorldGeometry geometry()
		{
			OdGiWorldGeometry result = (OdGiWorldGeometry)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiWorldDraw__geometry(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static IntPtr OdGiWorldDraw__OdGiWorldGeometry_Upcast(IntPtr ptr)
		{
			IntPtr result = GlobalsPINVOKE.OdGiWorldDraw__OdGiWorldDraw__OdGiWorldGeometry_Upcast(ptr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static IntPtr OdGiWorldDraw__OdGiGeometry_Upcast(IntPtr ptr)
		{
			IntPtr result = GlobalsPINVOKE.OdGiWorldDraw__OdGiWorldDraw__OdGiGeometry_Upcast(ptr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		private OdGiWorldGeometry pWGeom;

		private OdGiWorldGeometry pOdGiGeometry1;
	}
}
